package com.diaohw.platform.remote.auth;

import com.diaohw.platform.common.constant.ServiceConstant;
import com.diaohw.platform.framework.openfeign.GlobalFeignResultConfig;
import com.diaohw.platform.remote.auth.obj.bo.*;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = ServiceConstant.system, url = "${platform.openfeign.platform-system:}", configuration = GlobalFeignResultConfig.class,contextId = "authRemoteService")
public interface AuthRemoteService {


    @GetMapping("/account/{id}")
    @Operation(tags = "查看用户信息")
    AccountBO detail(@PathVariable("id") Long id);

    @GetMapping("/auth")
    @Operation(tags = "查看用户信息")
    List<AccountSaltBO> username(@RequestParam("username") String username);

    @GetMapping("/auth/{id}")
    @Operation(tags = "查看用户信息")
    AccountInfoBO accountInfo(@PathVariable("id") String id);

    @PutMapping("/auth/reset")
    @Operation(tags = "重置密码")
    Boolean reset(@RequestBody PasswordBO password);

    @PostMapping("/login-log")
    @Operation(tags = "插入登录日志")
    Boolean loginLog(@RequestBody LoginLogBO log);
}
